<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>图书信息管理</title>
</head>
<body class="hold-transition skin-black sidebar-mini">
    <div th:replace="common/fragment :: link"></div>
    <div class="wrapper">
        <div th:replace="common/fragment :: navbar"></div>
        <div th:replace="common/fragment :: menu"></div>
        <div class="content-wrapper">
            <section class="content-header">
                <h1>图书信息编辑</h1>
            </section>
            <section class="content">
                <div class="box">

                    <form class="form-horizontal" action="/book/saveOrUpdate" method="post" id="editForm" >

                        <input type="hidden" name="id" th:value="${book.id}">

                        <div class="form-group" style="margin-top: 10px;">
                            <label class="col-sm-2 control-label">图书名称：</label>
                            <div class="col-sm-6">
                                <input type="text" th:disabled="${book != null}" class="form-control" name="name" placeholder="请输入图书名称" th:value="${book.name}">
                            </div>
                        </div>
                        <div class="form-group" style="margin-top: 10px;">
                            <label class="col-sm-2 control-label">图书作者：</label>
                            <div class="col-sm-6">
                                <input type="text" th:disabled="${book != null}" class="form-control" name="author" placeholder="请输入图书名称" th:value="${book.author}">
                            </div>
                        </div>

                        <div class="form-group" style="margin-top: 10px;">
                            <label class="col-sm-2 control-label">图书出版社：</label>
                            <div class="col-sm-6">
                                <input type="text" th:disabled="${book != null}" class="form-control" name="publish" placeholder="请输入图书名称" th:value="${book.publish}">
                            </div>
                        </div>
                        <div class="form-group" style="margin-top: 10px;">
                            <label class="col-sm-2 control-label">图书编号：</label>
                            <div class="col-sm-6">
                                <input type="text" th:disabled="${book != null}" class="form-control" name="isbn" placeholder="请输入图书名称" th:value="${book.isbn}">
                            </div>
                        </div>
                        <div class="form-group" style="margin-top: 10px;">
                            <label class="col-sm-2 control-label">图书简介：</label>
                            <div class="col-sm-6">
                                <input type="text" th:disabled="${book != null}" class="form-control" name="introduction" placeholder="请输入图书名称" th:value="${book.introduction}">
                            </div>
                        </div>
                        <div class="form-group" style="margin-top: 10px;">
                            <label class="col-sm-2 control-label">图书语言：</label>
                            <div class="col-sm-6">
                                <input type="text" th:disabled="${book != null}" class="form-control" name="language" placeholder="请输入图书名称" th:value="${book.language}">
                            </div>
                        </div>
                        <div class="form-group" style="margin-top: 10px;">
                            <label class="col-sm-2 control-label">图书价格：</label>
                            <div class="col-sm-6">
                                <input type="text" th:disabled="${book != null}" class="form-control" name="price" placeholder="请输入图书名称" th:value="${book.price}">
                            </div>
                        </div>
                        <div class="form-group" style="margin-top: 10px;">
                            <label class="col-sm-2 control-label">图书出版时间：</label>
                            <div class="col-sm-6">
                                <input type="text" th:disabled="${book != null}" class="form-control" name="publish_date" placeholder="请输入图书名称" th:value="${book.publish_date}">
                            </div>
                        </div>
                        <div class="form-group" style="margin-top: 10px;">
                            <label class="col-sm-2 control-label">图书类型：</label>
                            <div class="col-sm-6">
                                <input type="text" th:disabled="${book != null}" class="form-control" name="type_id" placeholder="请输入图书名称" th:value="${book.type_id}">
                            </div>
                        </div>
                        <div class="form-group" style="margin-top: 10px;">
                            <label class="col-sm-2 control-label">图书状态：</label>
                            <div class="col-sm-6">
                                <input type="text" th:disabled="${book != null}" class="form-control" name="status" placeholder="请输入图书名称" th:value="${book.status}">
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="dept" class="col-sm-2 control-label">部门：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="dept" name="department.id">
                                    <option value="">请选择</option>
                                    <option
                                        th:each="department:${departments}"
                                        th:value="${department.id}"
                                        th:text="${department.name}"
                                        th:selected="${department.id == employee.department.id}">
                                    </option>
                                </select>
                            </div>
                        </div>


                        <div class="form-group">
                            <div class="col-sm-offset-1 col-sm-6">
                                <button type="submit" class="btn btn-primary btn-submit">保存</button>
                                <a href="javascript:window.history.back()" class="btn btn-danger">取消</a>
                            </div>
                        </div>

                    </form>
                </div>
            </section>
        </div>
        <div th:replace="common/fragment :: footer"></div>
    </div>
</body>
</html>